﻿
CREATE proc [dbo].[GetPostleitzahlOrt]
@PLZ	nvarchar(25) = null,
@Ort	nvarchar(75) = null
as
begin
	set nocount on
	
	select	p.EPLZ,
			p.LKZ,
			p.Ort,
			p.PLZ,
			p.Zone,
			p.Bundesland
	from	dbo.Postleitzahl p
	where	(p.PLZ = @PLZ
				or @PLZ is null)
			and (p.Ort= @Ort
				or @Ort is null)
	order by p.Ort, p.PLZ
end


GO
GRANT EXECUTE
    ON OBJECT::[dbo].[GetPostleitzahlOrt] TO PUBLIC
    AS [dbo];

